package com.work.shart.common.result;

public class Result {

    private Result() {
    }

    public static ResultVo success(Object data) {
        return ResultVo.builder().code(Code.SUCCESS_CODE).data(data).build();
    }

    public static ResultVo success(Object data, String msg) {
        return ResultVo.builder().code(Code.SUCCESS_CODE).data(data).msg(msg).build();
    }

    public static ResultVo success() {
        return ResultVo.builder().code(Code.SUCCESS_CODE).build();
    }

    public static ResultVo error(int code, String msg) {
        return ResultVo.builder().code(code).msg(msg).build();
    }
}

interface Code {
    int SUCCESS_CODE = 200;
}